import axios from '../axios'

export const adds = (data: { name: string }) => {
   return axios.request({ url: '/category', method: 'post', data })
}

export const remove = (id: number) => {
   return axios.request({ url: `/category/${id}`, method: 'delete' })
}

export const update = (id: number, data: { name: string }) => {
   return axios.request({ url: `/category/${id}`, method: 'Patch', data })
}

export const getAll = () => {
   return axios.request<{ name: string; id: number }>({ url: '/category' })
}
